package com.community.service.room;


import com.community.entity.ContactRoom;
import com.community.entity.Room;
import com.community.mapper.room.RoomMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class RoomService {

    @Autowired
    private RoomMapper roomMapper;

    public void addRoom(String uuid, String point, String building, String name, String room, String gender, String mobile, String userId) {

        roomMapper.add(uuid, point, building, name, room, gender, mobile, userId);
    }

    public void editRoom(String id, String point, String building, String name,String room, String gender, String mobile) {
    roomMapper.edit(id, point, building, name, room, gender, mobile);
    }

    public void modifyStatus(String id, String status) {
        roomMapper.modifyStatus(id, Integer.parseInt(status));
    }

    public List<Room> getRoomInfo(String userId) {
        return roomMapper.getRoomInfo(userId);
    }

    public void deleteRoom(String id) {
        roomMapper.deleteRoom(id);
    }

    public Room getRoomDetail(String id) {
        return roomMapper.getRoomDetail(id);
    }

    public List<ContactRoom> getStatusInfo(String id) {
        return roomMapper.getStatusInfo(id);
    }
}
